<?
  class Application_Model_CarValuations extends Zend_Db_Table_Abstract
  {
    protected $_name = "car_valuations";
	protected $_rowClass = "CarValuation";
  }

  class CarValuation extends Zend_Db_Table_Row
  {
    public static function calculateCost($valRow)
	{
	  if ($valRow->is_scrap == "Yes")
	    return 0;

	  return (int)($valRow->cost_clean + ($valRow->cost_clean * $valRow->cost_decrease_prc*0.01) + $valRow->cost_reduction);
	
	}

    public function getCost()
	{
	  return self::calculateCost($this);
	}
  }
